package com.solution.service;

import java.util.List;

import com.solution.exception.ServiceBeanException;
import com.solution.model.UserInfo;
import com.solution.model.UserQuestionMapping;
import com.solution.model.UserRole;
import com.solution.model.UserType;
import com.solution.util.SearchVO;


/**
 * This interface exposes all the services for creation, updation, read and
 * deletion of User.
 * 
 *
 */
public interface UserInfoService {

	/**
	 * This service creates the User entry in the database after performing
	 * required business logic.
	 * @param userInfo
	 * @return
	 * @throws ServiceBeanException
	 */
	public UserInfo create(UserInfo userInfo) throws ServiceBeanException;
	/**
	 * 
	 * @param userInfo
	 * @return
	 * @throws ServiceBeanException
	 */
	public List<UserInfo> create(List<UserInfo> userInfoList) throws ServiceBeanException;

	/**
	 * This service updates the User entry in the database after performing
	 * required business logic.
	 * @param userInfo
	 * @return
	 * @throws ServiceBeanException
	 */
	public UserInfo update(UserInfo userInfo) throws ServiceBeanException;
	
	/**
	 * This service updates the User entry and All related information belong to user in the database after performing
	 * required business logic.
	 * @param userInfo
	 * @return
	 * @throws ServiceBeanException
	 */
	public UserInfo updateUser(UserInfo userInfo) throws ServiceBeanException;
	
	/**
	 * This service reads a User from database based on the primary
	 * key.
	 * @param userInfoId
	 * @return
	 * @throws ServiceBeanException
	 */
	public UserInfo read(Long userInfoId) throws ServiceBeanException;
	
	/**
	 * Get User details
	 * @param userName
	 * @return
	 * @throws ServiceBeanException
	 */
	public UserInfo getUserDetail(String userName) throws ServiceBeanException;
	
	/**
	 * This service deletes a User from database based on the primary
	 * key.
	 * @param userInfoId
	 * @throws ServiceBeanException
	 */
	public void delete(Long userInfoId) throws ServiceBeanException;
	
	/**
	 * return encrypted password
	 * @param password
	 * @return
	 * @throws ServiceBeanException
	 */
	public String encryptPassword(String password) throws ServiceBeanException;
	
	/**
	 * Search list of user
	 * @param searchVO
	 * @return
	 * @throws ServiceBeanException
	 */
	public List<UserInfo> searchUser(SearchVO searchVO) throws ServiceBeanException ;
	
	/**
	 * list of roles of user
	 * @param userID
	 * @return
	 * @throws ServiceBeanException
	 */
	public List<UserRole> getUserRoleList(Long userID) throws ServiceBeanException ;
	
	/**
	 * get List of dealers for User
	 * @param userID
	 * @return
	 * @throws ServiceBeanException
	 */
	public List<Long> getDealerList(Long userInfoId) throws ServiceBeanException ;

	/**
	 * Validate whether user exist or not
	 * @param userInfo
	 * @return
	 * @throws ServiceBeanException
	 */
	public boolean validateUserPassword(UserInfo userInfo)  throws ServiceBeanException ;
	
	/**
	 * 
	 * @param userID
	 * @return
	 * @throws ServiceBeanException
	 */
	public List<UserType> getUserTypeList(Long userID) throws ServiceBeanException ; 
	/**
	 * 
	 * @param searchVO
	 * @return
	 * @throws ServiceBeanException
	 */
	
	public List<UserQuestionMapping> searchUserQuestionMappings(SearchVO searchVO) throws ServiceBeanException ;
	
	public void createUserQuestionMappings(List<UserQuestionMapping> userQuestionMappings) 
		throws ServiceBeanException;	

}
